# 方法一：使用set集合去重
test_list = [1, 2, 2, 3, 4, 4, 5, 1, 6]
def remove_duplicates_set(lst):
    return list(set(lst))
print( remove_duplicates_set(test_list))



# 方法二：使用字典去重
test_list = [1, 2, 7, 7, 3, 6, 4, 4, 5, 1, 6]
def remove_duplicates_dict(lst):
    return list(dict.fromkeys(lst))
print( remove_duplicates_dict(test_list))


# 方法三：使用循环遍历去重
test_list = [8, 2, 7, 9, 3, 6, 4, 9, 9, 1, 6]
def remove_duplicates_loop(lst):
    result = []
    for item in lst:
        if item not in result:
            result.append(item)
    return result
print( remove_duplicates_loop(test_list))